package com.itheima.web;

import com.itheima.service.UserService;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.sql.SQLException;
@Component//加入ioc容器
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/application.xml")
public class Test {


    @Autowired
    private UserService userService;


   @org.junit.Test
   public void Test1() throws SQLException {
        //调用转账方法
     userService.updataMoney(100,"rose","tom");

   }
   @org.junit.Test
    public void Test2()  {
      //存钱方法  存500
        userService.saveMoney("jack",500);


    }







}
